import request from '@/utils/request'

enum api {
  userList = '/admin/acl/user/',
  save = '/admin/acl/user/save',
  update = '/admin/acl/user/update',
  toAssign = '/admin/acl/user/toAssign/',
  doAssignRole = '/admin/acl/user/doAssignRole',
  remove = '/admin/acl/user/remove/',
  batchRemove = '/admin/acl/user/batchRemove',
}

export const reqUserList = (page: any, limit: any, username: any) =>
  request.get(api.userList + `${page}/${limit}?username=${username}`)

export const reqSave = (data: any) => request.post(api.save, data)

export const reqUpdate = (data: any) => request.put(api.update, data)

export const reqToAssign = (userId: any) => request.get(api.toAssign + userId)

export const reqDoAssignRole = (data: any) =>
  request.post(api.doAssignRole, data)

export const reqRemove = (data: any) => request.delete(api.remove + data)

export const reqBatchRemove = (data: any) =>
  request.delete(api.batchRemove, data)
